<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    canvas {
      border: 1px solid #000;
    }
  </style>
</head>

<body>
  <canvas width="600" height="400"></canvas>
</body>
<script>
  let canvas = document.querySelector("canvas")
  let ctx = canvas.getContext("2d")

  ctx.moveTo(0, 100)
  ctx.lineTo(600, 100)
  ctx.stroke()

  ctx.font = "60px 微软雅黑"
  // ctx.fillText("崔猛", 100, 100)
  // ctx.textBaseline="alphabetic"
  ctx.textBaseline="top"
  ctx.textBaseline="bottom"
  ctx.textBaseline="middle"
  ctx.fillText("XxGj", 100, 100)


</script>

</html>